using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using IdentityServer4.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Yozeev.SystemConfig;

namespace Yozeev.BusinessLogic
{
    /// <summary>
    /// 单据
    /// </summary>
    public class Activity : ByBranchEntity<Guid>
    {
        /// <summary>
        /// 单据号
        /// </summary>
        [Display(Name = "单据号")]
        public string ActivityNo { get; set; }
        /// <summary>
        /// 订单来源
        /// </summary>
        [Display(Name = "订单来源")]
        public Guid SourceId { get; set; }
        [ForeignKey("SourceId")]
        public virtual Source Source { get; set; }
        /// <summary>
        /// 航班标识
        /// </summary>
        [Display(Name = "航班标识")]
        public Guid? ScheduleId { get; set; }
        //[ForeignKey("ScheduleId")]
        //public virtual Schedule Schedule { get; set; }
        /// <summary>
        /// 原单据标识
        /// </summary>
        [Display(Name = "原单据标识")]
        public Guid? OrgActivityId { get; set; }
        //[ForeignKey("OrgActivityId")]
        //public virtual Activity OrgActivity { get; set; }
        /// <summary>
        /// 下单日期
        /// </summary>
        [Display(Name = "下单日期")]
        public DateTime ActivityDate { get; set; }
        /// <summary>
        /// 游玩日期
        /// </summary>
        [Display(Name = "游玩日期")]
        public DateTime PlayDate { get; set; }
        /// <summary>
        /// 游客标识
        /// </summary>
        [Display(Name = "游客标识")]
        public Guid CustomerId { get; set; }
        //[ForeignKey("CustomerId")]
        //public virtual Customer Customer { get; set; }
        /// <summary>
        /// 购票人
        /// </summary>
        [Display(Name = "购票人")]
        public string Buyer { get; set; }
        /// <summary>
        /// 手机号码
        /// </summary>
        [Display( Name ="手机号码")]
        public string Mobile { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        [Display(Name = "支付方式")]
        public Guid PayMethodId { get; set; }
        [ForeignKey("PayMethodId")]
        public virtual PayMethod PayMethod { get; set; }
        /// <summary>
        /// 支付凭证号
        /// </summary>
        [Display(Name = "支付凭证号")]
        public string VoucherNo { get; set; }
        /// <summary>
        /// 支付状态
        /// </summary>
        [Display(Name = "支付状态")]
        public PayStatusEnum PayStatus { get; set; }
        /// <summary>
        /// 单据类型
        /// </summary>
        [Display(Name = "单据类型")]
        public ActivityTypeEnum ActivityType { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// 是否打印
        /// </summary>
        [Display(Name = "是否打印")]
        public bool IsPrint { get; set; }
        /// <summary>
        /// 是否结账
        /// </summary>
        [Display(Name = "是否结账")]
        public bool Closed { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        [Display(Name = "数量")]
        public long TotalQuantity { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal TotalAmount { get; set; }
        /// <summary>
        /// 结账单号
        /// </summary>
        public Guid? AccountsId { get; set; }
        [ForeignKey("AccountId")]
        public virtual Account Account { get; set; }
        /// <summary>
        /// 订单分类
        /// </summary>
        public OrderTypeEnum OrderType { get; set; }
        /// <summary>
        /// 取票码
        /// </summary>
        [Display(Name = "取票码")]
        public string Code { get; set; }

        /// <summary>
        /// 旅行社标识
        /// </summary>
        public Guid? TravelAgencyId { get; set; }
        [ForeignKey("TravelAgencyId")]
        public TravelAgency TravelAgency { get; set; }
        public virtual ICollection<ActivityDetail> ActivityDetails { get; set; }
    }
}
